import java.util.*;

public class Text {

    public static void main(String[] args) {
        Set<String> set = new TreeSet<>();
        set.add("hello");
        set.add("word");
        set.add("lainghongquan");
        System.out.println(set.contains("hello"));
        System.out.println(set.size());
        Iterator<String> o = set.iterator();
        while(o.hasNext()){
            System.out.println(o.next());
        }
    }

    public static void main2(String[] args) {
        Map<String,Integer> map = new TreeMap<>();
        map.put("hello", 1);
        map.put("word", 2);
        map.put("lhhq", 3);
        map.put("kajb",1);
        map.put("hello", 4);
//        System.out.println(map.get("hello"));
//        System.out.println(map.getOrDefault("hello", 0));
//        System.out.println(map.getOrDefault("helo", 0));
        //System.out.println(map.remove("hello"));
        System.out.println(map.get("hello"));
        System.out.println(map.keySet());
        System.out.println(map.values());
        System.out.println(map.containsKey("hello"));
        System.out.println(map.containsKey("hel"));
        System.out.println(map.containsValue(1));
        System.out.println(map.containsValue(5));
        System.out.println();
        for(Map.Entry<String, Integer> entry : map.entrySet()){
            System.out.println("key: " + entry.getKey() + " value: " + entry.getValue());
        }
    }


    public static void main1(String[] args) {
        int[] array = {4,2,1,6};
        BinarySearchTree binarySearchTree = new BinarySearchTree();
        for (int i = 0; i < array.length; i++) {
            binarySearchTree.insert(array[i]);
        }
        System.out.println(binarySearchTree.search(14));
        System.out.println(binarySearchTree.search(4));

    }

}
